import java.util.*;
public class Myvecto {
	int x1,y1,x2,y2;
	Myvecto()
	{
		x1=y1=x2=y2=0;
	}
	Myvecto(int a1,int b1,int a2,int b2)
	{
		if(a1==a2&&b1==b2)
			System.out.print("\n ko tao vec to rong");
		else 
		{
			x1=a1;x2=a2;y2=b1;y2=b2;
		}
				
	}
	
	
	public boolean isEqual(Myvecto t)
	{
		double dd1,dd2;
		dd1=Math.sqrt(Math.pow(x2-x1,2)+Math.pow(y2-y1,2));
		dd2=Math.sqrt(Math.pow(t.x2-t.x1,2)+Math.pow(t.y2-t.y1,2));
		if((x2-x1==t.x2-t.x1&&y2-y1==t.y2-t.y1)&&dd1==dd2)
			return true;
		else 
			return false;
	}
	public String toString()
	{
		String t="";
		t="[" + x1 + ","+ y1 +"]---->["+x2+","+y2+"]";
		return t;
			
		
	}
	public static void main(String [] args){
		Myvecto v1,v2;
		v1=new Myvecto(1,2,3,5);
		v2=new Myvecto(1,2,3,5);
		if(v1.isEqual(v2))
			System.out.print("\n hai vecto "+v1+ "va "+v2+" bang nhau");
		else
			System.out.print("\n hai vecto "+v1+ "va "+v2+"ko bang nhau");
		v1.nhap();
		if(v1.isEqual(v2))
			System.out.print("\n hai vecto "+v1+ "va "+v2+" bang nhau");
		else
			System.out.print("\n hai vecto "+v1+ "va "+v2+"ko bang nhau");
	}

}
